/**
 * This file is part of 1genia trampoline
 * Copyright (C) 2007 1genia (contact@1genia.com)
 *
 * This library is free software; you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as
 * published by the Free Software Foundation; version 3 of the License. 
 *
 * This library is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Library General Public License for more details. 
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; see the file COPYING.TXT.  If not,
 * write to the Free Software Foundation, Inc., 51 Franklin Street,
 * Fifth Floor, Boston, MA 02110-1301, USA. 
 **/
package com.genia.toolbox.projects.tests.uml2model_test.business.dao;

import java.util.List;

import com.genia.toolbox.basics.exception.BundledException;
import com.genia.toolbox.model.exemple.B;
import com.genia.toolbox.model.exemple.impl.AssociateOfBImpl;
import com.genia.toolbox.model.exemple.impl.BImpl;
import com.genia.toolbox.persistence.exception.PersistenceException;

/**
 * the business dao test for entity of type <code>B</code>.
 */
public interface BbusinessDao
{

  /**
   * this method save an object B.
   * 
   * @param objTestB
   *          is of type <code>B</code>.
   * @return the identifier associate to <code>B</code> after he's been saved.
   * @throws PersistenceException
   *           occurs during persistence process.
   */
  public abstract Long saveB(B objTestB)
      throws PersistenceException;



  /**
   * test update.
   * 
   * @param objTestB
   *          is of type <code>BImpl</code>.
   * @throws PersistenceException
   *           occurs during persistence process.
   */
  public abstract void updateB(BImpl objTestB)
      throws PersistenceException;



  /**
   * create a new instance of an object B.
   * 
   * @return a new object of type <code>BImpl</code>.
   */
  public abstract BImpl createNewB();



  /**
   * get a list of objects <code>BImpl</code>.
   * 
   * @return a list of objects <code>BImpl</code>.
   * @throws PersistenceException
   *           occurs during persistence process.
   */
  public abstract List<BImpl> getListBs()
      throws PersistenceException;



  /**
   * get an object from his identifier.
   * 
   * @param identifier
   *          the id associate to <code>B</code>.
   * @return the object of type <code>B</code>.
   */
  public abstract B get(Long identifier);



  /**
   * remove association of type <code>AssociateOfBImpl</code>.
   * 
   * @param bImpl
   *          is of type <code>BImpl</code>.
   * @param associateOfB
   *          is of type <code>AssociateOfBImpl</code>.
   * @throws PersistenceException
   *           occurs during persistence process.
   */
  public void removeAssociateOfB(BImpl bImpl, AssociateOfBImpl associateOfB)
      throws PersistenceException;



  /**
   * get the associate by name.
   * 
   * @param objTestB
   *          the object <code>B</code>.
   * @return the object of type <code>AssociateOfBImpl</code>.
   * @throws PersistenceException
   *           occurs during persistence process.
   */
  public abstract AssociateOfBImpl getAssociate(B objTestB)
      throws PersistenceException;



  /**
   * add an associate of type <code>AssociateOfB</code>.
   * 
   * @param objTestB
   *          the object of type <code>B</code>.
   * @param associateOfB
   *          associate of type <code>AssociateOfB</code>
   * @throws PersistenceException
   *           occurs during persistence process.
   * @throws BundledException
   *           when errors occurs.
   */
  public abstract void addAssociateOfB(BImpl objTestB, AssociateOfBImpl associateOfB)
      throws PersistenceException, BundledException;



  /**
   * delete an object <code>B</code> from his identifier.
   * 
   * @param identifier
   *          the id associate to <code>B</code>.
   * @throws PersistenceException
   *           errors occurs when delete fail.
   */
  public abstract void delete(Long identifier)
      throws PersistenceException;



  /**
   * this method delete all object B.
   * 
   * @throws PersistenceException
   *           occurs during persistence process.
   */
  public abstract void deleteAll()
      throws PersistenceException;
}
